<template>
  <div>
    <LifeCycle v-if="flag" />
    <button @click="flag = !flag">点我销毁子组件</button>
  </div>
</template>
ccccccccccccc
<script>
import LifeCycle from './components/LifeCycle.vue'
export default {
  components: {
    LifeCycle
  },
  data() {
    return {
      flag: true
    }
  }
}
</script>

<style>

</style>